package com.honglv.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.honglv.pojo.entity.Attractions;
import com.honglv.pojo.dto.UpdateAcctractionDTO;
import com.honglv.pojo.vo.GetAllAttractionsVO;
import com.honglv.pojo.vo.GetAttractionVO;
import com.honglv.pojo.vo.GetTopAttractionVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AttractionsMapper extends BaseMapper<Attractions> {

    GetAttractionVO getAcctraction(@Param("id") Long id);

    Long like(@Param("id") Long id, @Param("num") Integer num);

    Long getLikeCount(@Param("id") Long id);

    List<GetAllAttractionsVO> getAllAttractions();

    List<GetTopAttractionVO> getTopAttraction();

    List<GetTopAttractionVO> getAttractionsByAuthorId(@Param("userId") Long id);

    @Delete("DELETE FROM tb_attractions WHERE id = #{id}")
    void deleteAcctraction(@Param("id") Long id);

    Integer updateAcctraction(UpdateAcctractionDTO updateAcctractionDTO);
}
